package ru.amse.vlassiev;

import ru.amse.vlassiev.reader.*;
import ru.amse.vlassiev.model.*;
import ru.amse.vlassiev.view.*;
import ru.amse.vlassiev.TestPackage.*;
import java.io.*;
import javax.swing.*;
import java.awt.Component;

public class Syslog {

	public static void main(String[] args) {
		
		final MainWindow mainWindow = new MainWindow("Syslog");
		IFiltrator filtrator = new Filtrator();

		try{
		IView testGraph1 = new Graph("Graph 1");
		IView testGraph5 = new Graph("Graph 5");
		IView testTable5 = new Table("Table 5");
		IView testGraph1000 = new Graph("Graph 1000");
		mainWindow.addView((JPanel) testGraph1);
		mainWindow.addView((JPanel) testGraph5);
		mainWindow.addView((JPanel) testGraph1000);
		mainWindow.addView((JPanel) testTable5);
		IReader reader = new LogFileReader(new File("logtest.dat"), 10);
//		IReader reader = new UDPReader(514);
		IView viewSyso = new SysoView("view");
		IFilter filter1 = new Filter("recvif=Corbina", 1, testGraph1);
		IFilter filter5 = new Filter("recvif=Corbina", 5, testGraph5);
		IFilter filter1000 = new Filter("recvif=Corbina", 1000, testGraph1000);
		filter1.addView(viewSyso);
		filter5.addView(testTable5);
		filtrator.addFilter(filter1);
		filtrator.addFilter(filter5);
		filtrator.addFilter(filter1000);
		reader.addListener(filtrator);
		reader.start();

		

		} catch (Exception e) {
		}
	}
	
	
}
